package com.ai.aicodemather.service;

import com.ai.aicodemather.model.dto.UserAddRequest;
import com.ai.aicodemather.model.dto.UserLoginRequest;
import com.ai.aicodemather.model.dto.UserQueryRequest;
import com.ai.aicodemather.model.dto.UserUpdateRequest;
import com.ai.aicodemather.model.vo.UserLoginResponseVo;
import com.ai.aicodemather.model.vo.UserVO;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.core.service.IService;
import com.ai.aicodemather.model.entity.User;
import jakarta.servlet.http.HttpServletRequest;

import java.util.List;

/**
 *  服务层。
 *
 * @author aiCodeMather
 * @since 2023-03-30
 */
public interface UserService extends IService<User> {

    /**
     * 用户注册
     * @param userAccount
     * @param userPassword
     * @param checkPassword
     * @return
     */
    long registerUser(String userAccount, String userPassword, String checkPassword);

    /**
     * 用户登录
     * @param userAccount
     * @param userPassword
     * @param httpRequest
     * @return
     */
    UserLoginResponseVo userLogin(String userAccount, String userPassword, HttpServletRequest httpRequest);

    /**
     * 获取当前登录用户
     * @param httpRequest
     * @return
     */
    User getLoginUser(HttpServletRequest httpRequest);

    /**
     * 获取当前登录用户-脱敏
     * @param httpRequest
     * @return
     */
    UserLoginResponseVo getLoginUserVo(HttpServletRequest httpRequest);

    /**
     * 用户登出
     * @param httpRequest
     * @return
     */
    boolean userLogout(HttpServletRequest httpRequest);

    /**
     * 密码加密
     * @param userPassword
     * @return
     */
    String getEncryptPassword(String userPassword);

    /**
     * 获取用户登录响应信息
     * @param user
     * @return
     */
    UserLoginResponseVo getUserLoginResponseVo(User user);

    UserVO getUserVO(User user);

    List<UserVO> getUserVOList(List<User> userList);

    QueryWrapper getQueryWrapper(UserQueryRequest userQueryRequest);
}
